patientId = url('?userid')
//nav---患者档案
let nav_files = [
	{
		img: 'img/tab/basic.png',
		title: '基本信息',
		link: 'basic_info',
		linkpath: 'files/baseInfo.html',
	},
	{
		img: 'img/tab/life.png',
		title: '生活方式',
		link: 'life',
		linkpath: 'files/lifeStyle.html',
	},
	{
		img: 'img/tab/overview.png',
		title: '糖尿病概况',
		link: 'overview',
		linkpath: 'files/overView.html',
	},
	//	{
	//		img: "img/tab/treatment.png",
	//		title: "当前治疗方案",
	//		link: "treatment",
	//		linkpath: "",
	//	},
	{
		img: 'img/tab/education.png',
		title: '糖尿病教育',
		link: 'education',
		linkpath: 'files/educate.html',
	},
	{
		img: 'img/tab/concurrent.png',
		title: '糖尿病并发症',
		link: 'concurrent',
		linkpath: 'files/complication.html',
	},
	{
		img: 'img/tab/merge.png',
		title: '糖尿病合并症',
		link: 'merge',
		linkpath: 'files/comorbidity.html',
	},
	{
		img: 'img/tab/history.png',
		title: '既往病史与过敏史',
		link: 'history',
		linkpath: 'files/anamnesis.html',
	},
	{
		img: 'img/tab/body.png',
		title: '体格检查',
		link: 'body',
		linkpath: 'files/physical.html',
	},
	{
		img: 'img/tab/experiment.png',
		title: '实验室检测',
		link: 'experiment',
		linkpath: 'files/laboratory.html',
	},
	{
		img: 'img/tab/pic.png',
		title: '影像学检查',
		link: 'pic',
		linkpath: 'files/iconography.html',
	},
	//	{
	//		img: "img/tab/reverse.png",
	//		title: "逆转方案",
	//		link: "reverse",
	//		linkpath: "",
	//	},
]

$.each(nav_files, function (i, v) {
	let time = new Date().getHours()
	let html = [
		'<li class="nav_item" linkpath=' + v.linkpath + '?t=' + time + '>',
		'	<div class="text-center">',
		'		<img src="' + v.img + '"/>',
		'		<p>' + v.title + '</p>',
		'	</div>',
		'</li>',
	].join('')
	$(html).appendTo('.nav_list_files')
})

$('.nav_item').each(function (i) {
	$('.nav_item')
		.eq(i)
		.click(function () {
			if ($(this).attr('linkpath')) {
				window.location.href = $(this).attr('linkpath')
			} else {
				syalert.syopen('alert3')
			}
		})
})

//nav---日常监测
let nav_daily = [
	{
		img: 'img/tab/sugar.png',
		title: '血糖监测',
		link: 'sugar',
		linkpath: 'BloodProfile/bloodSugar.html?userid=' + patientId,
	},
	{
		img: 'img/tab/diet.png',
		title: '饮食监测',
		link: 'diet',
		linkpath: 'BloodProfile/diet.html',
	},
	{
		img: 'img/tab/sport.png',
		title: '运动监测',
		link: 'sport',
		linkpath: 'BloodProfile/sport.html',
	},
	{
		img: 'img/tab/pill.png',
		title: '用药监测',
		link: 'pill',
		linkpath: 'BloodProfile/medical.html',
	},
	{
		img: 'img/tab/insulin.png',
		title: '胰岛素监测',
		link: 'insulin',
		linkpath: 'BloodProfile/insulin.html',
	},
	{
		img: 'img/tab/ketones.png',
		title: '尿酮监测',
		link: 'ketones',
		linkpath: 'BloodProfile/ketone.html',
	},
	{
		img: 'img/tab/blood.png',
		title: '血压监测',
		link: 'blood',
		linkpath: 'BloodProfile/bloodPressure.html',
	},
	{
		img: 'img/tab/bmi.png',
		title: 'BMI监测',
		link: 'bmi',
		linkpath: 'BloodProfile/bmi.html?userid=' + patientId,
	},
	{
		img: 'img/tab/waistline.png',
		title: '腰围监测',
		link: 'waistline',
		linkpath: 'BloodProfile/waist.html',
	},
	{
		img: 'img/tab/sleeptime.png',
		title: '睡眠监测',
		link: 'sleeptime',
		linkpath: 'BloodProfile/sleep.html',
	},
	//	{
	//		img: "img/tab/sign_in.png",
	//		title: "打卡记录",
	//		link: "sign_in",
	//		linkpath: "",
	//	},
	{
		img: 'img/tab/advice.png',
		title: '监测建议',
		link: 'advice',
		linkpath: 'BloodProfile/advise.html',
	},
]

$.each(nav_daily, function (i, v) {
	let time = new Date().getHours()
	let html = [
		'<li class="nav_item" linkpath=' + v.linkpath + '?t=' + time + '>',
		'	<div class="text-center">',
		'		<img src="' + v.img + '"/>',
		'		<p>' + v.title + '</p>',
		'	</div>',
		'</li>',
	].join('')
	$(html).appendTo('.nav_list_daily')
})

$('.nav_item').each(function (i) {
	$('.nav_item')
		.eq(i)
		.click(function () {
			if ($(this).attr('linkpath')) {
				window.location.href = $(this).attr('linkpath')
			} else {
				syalert.syopen('alert3')
			}
		})
})

//nav---量表评估---患者行为量表
let nav_assess_behavior = [
	{
		// img: "img/evalution/sdsca.png",
		title: '自我管理行为(SDSCA)',
		link: 'sdsca',
		time: '答题时间:10分钟',
		count: '未填写',
		linkpath: 'evalution/behavior/sdscaInfo.html',
	},
	// {
	// 	// img: "img/evalution/c-dmses.png",
	// 	title: "自我管理效能(C-DMSES)",
	// 	link: "c-dmses",
	// 	time: "答题时间:10分钟",
	// 	count: '未填写',
	// 	linkpath: "",
	// },
	// {
	// 	// img: "img/evalution/dcp.png",
	// 	title: "密西根糖尿病管理评定量表(DCP)",
	// 	link: "dcp",
	// 	time: "答题时间:10分钟",
	// 	count: '未填写',
	// 	linkpath: "",
	// },
	// {
	// 	// img: "img/evalution/adknowl.png",
	// 	title: "患者知识量表(ADKnowl)",
	// 	link: "adknowl",
	// 	time: "答题时间:60分钟",
	// 	count: '未填写',
	// 	linkpath: "",
	// },
	{
		// img: "img/evalution/mmas-8.png",
		title: 'Morisky用药依从性问卷(MMAS-8)',
		link: 'mmas-8',
		time: '答题时间:10分钟',
		count: '未填写',
		linkpath: 'evalution/behavior/mmas8Info.html',
	},
	{
		// img: "img/evalution/bmq.png",
		title: '服药信念量表(BMQ)',
		link: 'bmq',
		time: '答题时间:10分钟',
		count: '未填写',
		linkpath: 'evalution/behavior/bmqInfo.html',
	},
]

//nav---量表评估---疾病评估量表
let nav_assess_disease = [
	// {
	// 	// img: "img/evalution/complication.png",
	// 	title: "并发症评估",
	// 	link: "complication",
	// 	time: "答题时间:10分钟",
	// 	count: '未填写',
	// 	linkpath: "",
	// },
	{
		// img: "img/evalution/diabetes.png",
		title: '糖尿病风险评估',
		link: 'diabetes',
		time: '答题时间:10分钟',
		count: '未填写',
		linkpath: 'evalution/disease/diabetesInfo.html',
	},
	{
		// img: "img/evalution/cardiovascular.png",
		title: '心血管十年风险评估',
		link: 'cardiovascular',
		time: '答题时间:10分钟',
		count: '未填写',
		linkpath: 'evalution/disease/cardiovascularInfo.html',
	},
]
//nav---量表评估---心里行为量表
let nav_assess_psychology = [
	{
		// img: "img/evalution/sas.png",
		title: '焦虑自评(SAS)',
		link: 'sas',
		time: '答题时间:10分钟',
		count: '未填写',
		linkpath: 'evalution/psychology/sasInfo.html',
	},
	{
		// img: "img/evalution/sds.png",
		title: '抑郁自评(SDS)',
		link: 'sds',
		time: '答题时间:10分钟',
		count: '未填写',
		linkpath: 'evalution/psychology/sdsInfo.html',
	},
	// {
	// 	// img: "img/evalution/16pf.png",
	// 	title: "卡特尔十六种人格因素测验(16PF) ",
	// 	link: "16pf",
	// 	time: "答题时间:60分钟",
	// 	count: '未填写',
	// 	linkpath: "",
	// },
	{
		// img: "img/evalution/burnout.png",
		title: '马氏工作倦怠通用量表',
		link: 'burnout',
		time: '答题时间:10分钟',
		count: '未填写',
		linkpath: 'evalution/psychology/burnoutInfo.html',
	},
	// {
	// 	// img: "img/evalution/style.png",
	// 	title: "明尼苏达多相个性测查表",
	// 	link: "style",
	// 	time: "答题时间:3小时",
	// 	count: '未填写',
	// 	linkpath: "",
	// },
	{
		// img: "img/evalution/psqi.png",
		title: '匹兹堡睡眠质量指数(PSQI)',
		link: 'psqi',
		time: '答题时间:10分钟',
		count: '未填写',
		linkpath: 'evalution/psychology/psqiInfo.html',
	},
	// {
	// 	// img: "img/evalution/scl-90.png",
	// 	title: "心理健康临床症状自评测验(SCL-90)",
	// 	link: "scl-90",
	// 	time: "答题时间:60分钟",
	// 	count: '未填写',
	// 	linkpath: "",
	// },
	{
		// img: "img/evalution/happiness.png",
		title: '总体幸福感测试',
		link: 'happiness',
		time: '答题时间:30分钟',
		count: '未填写',
		linkpath: 'evalution/psychology/happinessInfo.html',
	},
]

//nav---量表评估---体能
let nav_assess_sport = [
	{
		// img: "img/evalution/sas.png",
		title: '体能活动就绪问卷',
		link: 'sas',
		time: '答题时间:5分钟',
		count: '未填写',
		linkpath: 'evalution/others/sportInfo.html',
	}
]

//nav---量表评估---营养
let nav_assess_nur = [
	{
		// img: "img/evalution/sas.png",
		title: '营养风险筛查评估表',
		link: 'nur',
		time: '答题时间:5分钟',
		count: '未填写',
		linkpath: 'evalution/others/nurInfo.html',
	}
]

$.each(nav_assess_behavior, function (i, v) {
	var html = [
		'<li class="nav_evalution" linkpath=' + v.linkpath + '>',
		'	<div >',
		'<span class="icon">',

		'</span>',
		// '		<img src="' + v.img + '"/>',
		'	<span class="evalution_title1">' + v.title + '</span>',
		'<div class="evalution_time">',
		'<span class="evalution_left">' + v.time + '</span>',
		'<span class="evalution_right evalution_count1' +
			i +
			'">' +
			v.count +
			'</span>',

		'</div>',
		'	</div>',
		'</li>',
	].join('')
	$(html).appendTo('.nav_list_assess_behavior')
})

$.each(nav_assess_disease, function (i, v) {
	var html = [
		'<li class="nav_evalution" linkpath=' + v.linkpath + '>',
		'	<div >',
		'<span class="icon">',

		'</span>',
		// '		<img src="' + v.img + '"/>',
		'	<span class="evalution_title1">' + v.title + '</span>',
		'<div class="evalution_time">',
		'<span class="evalution_left">' + v.time + '</span>',
		'<span class="evalution_right evalution_count2' +
			i +
			'">' +
			v.count +
			'</span>',

		'</div>',
		'	</div>',
		'</li>',
	].join('')
	$(html).appendTo('.nav_list_assess_disease')
})

$.each(nav_assess_psychology, function (i, v) {
	var html = [
		'<li class="nav_evalution" linkpath=' + v.linkpath + '>',
		'	<div >',
		'<span class="icon">',

		'</span>',
		// '		<img src="' + v.img + '"/>',
		'	<span class="evalution_title1">' + v.title + '</span>',
		'<div class="evalution_time">',
		'<span class="evalution_left">' + v.time + '</span>',
		'<span class="evalution_right evalution_count3' +
			i +
			'">' +
			v.count +
			'</span>',

		'</div>',
		'	</div>',
		'</li>',
	].join('')
	$(html).appendTo('.nav_list_assess_psychology')
})

$.each(nav_assess_sport, function (i, v) {
	var html = [
		'<li class="nav_evalution" linkpath=' + v.linkpath + '>',
		'	<div >',
		'<span class="icon">',

		'</span>',
		'	<span class="evalution_title1">' + v.title + '</span>',
		'<div class="evalution_time">',
		'<span class="evalution_left">' + v.time + '</span>',
		'<span class="evalution_right evalution_count4">' +
			v.count +
			'</span>',

		'</div>',
		'	</div>',
		'</li>',
	].join('')
	$(html).appendTo('.nav_list_assess_sport')
})

$.each(nav_assess_nur, function (i, v) {
	var html = [
		'<li class="nav_evalution" linkpath=' + v.linkpath + '>',
		'	<div >',
		'<span class="icon">',

		'</span>',
		'	<span class="evalution_title1">' + v.title + '</span>',
		'<div class="evalution_time">',
		'<span class="evalution_left">' + v.time + '</span>',
		'<span class="evalution_right evalution_count5">' +
			v.count +
			'</span>',

		'</div>',
		'	</div>',
		'</li>',
	].join('')
	$(html).appendTo('.nav_list_assess_nur')
})


$('.nav_evalution').each(function (i) {
	$('.nav_evalution')
		.eq(i)
		.click(function () {
			if ($(this).attr('linkpath')) {
				window.location.href = $(this).attr('linkpath')
			} else {
				syalert.syopen('alert3')
			}
		})
})
